package com.yuyou.tas.lesson.mapper;

import com.yuyou.tas.service.api.lesson.dto.DtoBaseChapter;
import com.yuyou.tas.service.api.lesson.entity.BaseChapter;
import com.yuyou.tas.util.bean.Pagination;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BaseChapterMapper {
    int deleteByPrimaryKey(Long id);

    int insert(BaseChapter record);

    BaseChapter selectByPrimaryKey(Long id);

    List<BaseChapter> selectByPrimaryKeys(List<Long> list);
    
    int updateByPrimaryKeySelective(BaseChapter record);

    int findChapterCount(Pagination<DtoBaseChapter> queryPgn);

    List<DtoBaseChapter> findChapterPageList(Pagination<DtoBaseChapter> queryPgn);

    BaseChapter selectByPKandOrgan(@Param(value="id") Long id, @Param(value="authOrganizationId") Long authOrganizationId);

    Integer findByResourceId(@Param(value = "resourceId") String resourceId);
    
    int findCountByLectureUrl(String lectureUrl);
    
    int findCountByCourseUrl(String courseUrl);
    
    /**
     * 根据lectureUrl查出唯一BaseChapter
     * @param lectureUrl
     * @return
     */
    BaseChapter selectByLectureUrl(String lectureUrl);
    
    /**
     * 根据courseUrl查出唯一BaseChapter
     * @param lectureUrl
     * @return
     */
    BaseChapter selectByCourseUrl(String courseUrl);
    
    /**
     * 根据lessonClassId和lectureUrl查出唯一BaseChapter
     * @param lessonClassId
     * @param lectureUrl
     * @return
     */
    BaseChapter selectByCla7LectureUrl(@Param(value = "lessonClassId")Long lessonClassId,@Param(value = "lectureUrl")String lectureUrl);
    
    /**
     * 根据lessonClassId和courseUrl查出唯一BaseChapter
     * @param lessonClassId
     * @param courseUrl
     * @return
     */
    BaseChapter selectByCla7CourseUrl(@Param(value = "lessonClassId")Long lessonClassId,@Param(value = "courseUrl")String courseUrl);
    
    
    
}